﻿using System;

namespace IFD2
{
    public partial class SearchPax : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["ACL"].ToString().IndexOf("SB1") < 0)
            {
                Response.Redirect("unauthorized.aspx");
            }

            lblError.Text = "";
        }

        protected void btnSearchTkt_Click(object sender, EventArgs e)
        {
            if (txtCheckCode.Text.ToLower() != Session["CHK_CODE"].ToString())
            {
                lblError.Text = "Please input the check code!";
                txtCheckCode.Text = "";
                return;
            }
            txtCheckCode.Text = "";

            hidType.Value = "T";
            GridView1.DataBind();
            if (GridView1.Rows.Count == 0)
                lblError.Text = "Passenger not found, or unauthorized!";
        }

        protected void btnSearchOrder_Click(object sender, EventArgs e)
        {
            if (txtCheckCode.Text.ToLower() != Session["CHK_CODE"].ToString())
            {
                lblError.Text = "Please input the check code!";
                txtCheckCode.Text = "";
                return;
            }
            txtCheckCode.Text = "";

            hidType.Value = "O";
            GridView1.DataBind();
            if (GridView1.Rows.Count == 0)
                lblError.Text = "Passenger not found, or unauthorized!";
        }
    }
}